import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate"

Vue.use(Vuex)
import state from "./state"
import mutations from "./mutations"
import actions from "./actions"
export default new Vuex.Store({
  state,
  mutations,
  actions,
  plugins: [createPersistedState({
    storage: window.localStorage,
    reducer(val) {
      return {
        carts : val.carts,
        orders: val.orders
        
      }
    }
  })]
})